import { database } from "./database.js";

new Vue( {
    el: "#app",

    data: {
        db: {
            ready: false,
            readyMsg: "数据库已准备就绪",
            readyMsgHidden: false
        }
    },

    mounted: function () {
        const vm = this;

        database.existenceTest().then( function () {
            vm.db.ready = true;
            setTimeout( function () {
                vm.db.readyMsgHidden = true;
            }, 1500 );
        }, function ( e ) {

        } );
    },

    template: `
        <well-app>
            <well-box>
                <transition name="v-record-fade">
                    <well-msg v-if="db.ready && !db.readyMsgHidden">{{ db.readyMsg }}</well-msg>
                </transition>
            </well-box>
        </well-app>
    `
} );